package xyz.yq56.easytool.utils.thread;

import java.util.concurrent.TimeUnit;

import lombok.extern.slf4j.Slf4j;
import xyz.yq56.easytool.utils.log.LogUtil;

/**
 * @author yi qiang
 * @date 2021/9/20 10:03
 */
@Slf4j
public class ThreadUtil {

    private ThreadUtil() {
    }

    /**
     * 休眠
     *
     * @param timeout  超时时长
     * @param timeUnit 时间单位
     */
    public static void sleep(long timeout, TimeUnit timeUnit) {
        try {
            timeUnit.sleep(timeout);
        } catch (InterruptedException e) {
            LogUtil.warn("Sleep", e,null);
        }
    }

}
